package com.example.shopping.service.impl;

import com.example.shopping.mapper.ProductsMapper;
import com.example.shopping.service.Products;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @description: TODO
 * @author: uu
 * @data: 2023/6/29 18:37
 * @version: v1.0
 */
@Service
public class ProductsImpl implements Products {

    @Autowired
    ProductsMapper mapper;
    @Override
    public Boolean postProducts(com.example.shopping.pojo.Products product) {
        int insert = mapper.insert(product);
        return insert ==1 ;
    }

    @Override
    public List<com.example.shopping.pojo.Products> findProducts() {
        List<com.example.shopping.pojo.Products> all = mapper.findAll();
        return all;
    }

}
